<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="tpl :: common_head()"></th:block>
    <link rel="stylesheet" type="text/css" href="../../assets/libs/videoUpload/pictureUpload.css"/>
    <script src="../../assets/libs/videoUpload/pictureUpload.js"></script>
    <title>产废单位管理</title>
</head>
<body th:object="${obj}" th:with="entrance='/system/productWasteManagement/index'">
<th:block th:replace="tpl :: common_body(~{::.main-right})">
    <div class="main-right">
        <h1 class="main-right-h1" th:if="*{id!=null}">产废单位编辑</h1>
        <h1 class="main-right-h1" th:if="*{id==null}">产废单位新增</h1>
        <ul class="main-right-tab">
            <li><a href="index">列表</a></li>
            <li class="selected" th:if="*{id==null}">新增</li>
            <li class="selected" th:if="*{id!=null}">编辑</li>
        </ul>
        <form class="form" method="POST" onsubmit="return fileCheck()">
            <fieldset>
                <legend>信息</legend>
                <dl>
                    <dt>企业名称</dt>
                    <dd>
                        <input type="text" th:field="*{name}" data-verify="required(1)"/>
                    </dd>
                    <dt>单位管理员名称</dt>
                    <dd>
                        <input type="text" th:field="*{memberName}" data-verify="required(1)"/>
                    </dd>
                    <dt>单位管理员手机号</dt>
                    <dd>
                        <input type="text" th:field="*{mobile}" data-verify="required(1)"/>
                    </dd>
                    <dt>法定代表人</dt>
                    <dd>
                        <input type="text" th:field="*{legalRepresentative}" data-verify="required(1)"/>
                    </dd>
                    <dt>营业执照注册号</dt>
                    <dd>
                        <input type="text" th:field="*{licenseNumber}" data-verify="required(1)" />
                    </dd>
                    <dt>省</dt>
                    <dd>
                        <input type="text" th:field="*{province}" data-verify="required(1)"/>
                    </dd>
                    <dt>市</dt>
                    <dd>
                        <input type="text" th:field="*{city}" data-verify="required(1)"/>
                    </dd>
                    <dt>区</dt>
                    <dd>
                        <input type="text" th:field="*{area}" data-verify="required(1)"/>
                    </dd>
                    <dt>地址</dt>
                    <dd>
                        <input type="text" th:field="*{address}" data-verify="required(1)"/>
                    </dd>
                    <dt>所属行业</dt>
                    <dd>
                        <select class="js-example-basic-single" th:field="*{industry}">
                            <option th:each="op:*{@dictService.getByType('org_industry')}" th:value="${op.label}"
                                    th:text="${op.label}"></option>
                        </select>
                    </dd>
                    <dt>年产危废规模</dt>
                    <dd>
                        <select class="js-example-basic-single" th:field="*{wasteScale}">
                            <option th:each="op:*{@dictService.getByType('org_waste_scale')}" th:value="${op.label}"
                                    th:text="${op.label}"></option>
                        </select>
                    </dd>

                    <div id="uploadFile"></div>

                    <div id="multiImg">
                        <div id="pic0">
                            <dt>文件上传</dt>
                            <dd>
                                <img id="coverImage0" onclick="showImage('coverImage0','post')" style="width:200px"
                                     src="../../assets/images/add.png"/>
                            </dd>
                        </div>
                    </div>
                </dl>
                <input type="hidden" name="attachStr" id="attachStr" th:value="${attachStr}">
                <input type="submit" value="提交"/>
            </fieldset>
        </form>
    </div>
</th:block>
</body>
<script>

    var attachList = new Array();

    function deletes(i) {
        delete attachList[i];
        $("#file" + i).remove();
    }

    function fileCheck() {
        $('#attachStr').val(attachList.join(','))
    }

    var index = "";

    function close() {
        layer.close(index);
    }

    function showImage(image, type) {
        index = layer.open({
            type: 2,
            area: ['1240px', '500px'],
            title: "文件上传",
            shade: 0.6,
            scrollbar: false,
            fixed: true,
            maxmin: true,
            content: "../show/showFilePage/" + type + "/" + image
        });
    }
</script>
<style>
    .form dt {
        width: 135px;
    }
</style>
</html>